Clean up jtr, gopal, random, stmsdf explicit use of microseconds member.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 02:46:35 +0000 (02:46 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 Jul 2013 02:46:35 +0000 (02:46 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4447 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/gopal.cc
gpsbabel/jtr.cc
gpsbabel/random.cc
gpsbabel/stmsdf.cc

index 10c3b323d5df8ccb4d7747b2cb5a025d4c01669a..e66f4b36078ecb36133d1b2f26d22bccd47d57b9 100644 (file)
@@ -217,8 +217,7 @@ gopal_read(void)
       switch (column) {
       case  0: /* "-" */       /* unknown fields for the moment */
         sscanf(c, "%lu", &microsecs);
-        wpt->microseconds += microsecs % 1000000;
-        wpt->creation_time += microsecs / 1000000;
+        wpt->SetCreationTime(microsecs / 1000000, microsecs % 1000000);
         break;
       case  1:                         /* Time UTC */
         sscanf(c,"%lf",&hmsd);
index 70f8483749367c20fe9fed4c1368d253d01fc435..583c6c8b70be417a0e78e35ea9e2f85e32470624 100644 (file)
@@ -280,8 +280,8 @@ jtr_trkpt_disp_cb(const waypoint* wpt)
     tm.tm_year += 1900;
     tm.tm_mon += 1;
     snprintf(sdate, sizeof(sdate), "%02d%02d%02d", tm.tm_mday, tm.tm_mon, tm.tm_year % 100);
-    snprintf(stime, sizeof(stime), "%02d%02d%02d.%02d", tm.tm_hour, tm.tm_min, tm.tm_sec, wpt->microseconds / 10000);
-    if (wpt->microseconds / 10000 == 0) {
+    snprintf(stime, sizeof(stime), "%02d%02d%02d.%02d", tm.tm_hour, tm.tm_min, tm.tm_sec, wpt->creation_time.time().msec());
+    if (wpt->creation_time.time().msec() == 0) {
       stime[6] = 0;
     }
   } else {
index 20f62ffd6317d126004bb217afce32742623e240..3954bf14da5a8ae995f0fe15d0142cf7f15ecff4 100644 (file)
@@ -161,7 +161,7 @@ random_read(void)
 
     wpt->creation_time = time;
     if RND(3) {
-      wpt->microseconds = rand_int(1000) * 1000;
+      wpt->creation_time.addMSecs(rand_int(1000) * 1000);
     }
     time += rand_int(10) + 1;
 
index 6534565bbfa821be554605e54b778f77c6b3d26e..70f34858df1d9b553c38bf24a2f190aca8177955 100644 (file)
@@ -203,7 +203,7 @@ finalize_tracks(void)
 
   for (index = 0; index < count; index++) {
     waypoint *wpt = list[index];
-    if (wpt->microseconds == 2) {      /* log continued */
+    if (wpt->wpt_flags.fmt_use == 2) { /* log continued */
       track = NULL;
     }
     if (track == NULL) {
@@ -222,10 +222,10 @@ finalize_tracks(void)
       }
     }
     track_add_wpt(track, wpt);
-    if (wpt->microseconds == 1) { /* log pause */
+    if (wpt->wpt_flags.fmt_use == 1) { /* log pause */
       track = NULL;
     }
-    wpt->microseconds = 0;
+    wpt->wpt_flags.fmt_use = 0;
   }
 
   xfree(list);
@@ -312,7 +312,7 @@ parse_point(char *line)
       break;
     case 11:
       if (what == 1) {
-        wpt->microseconds = atoi(str);  /* memory point type */
+        wpt->wpt_flags.fmt_use = atoi(str);  /* memory point type */
       }
       break;
     }